import Vue from 'vue';
import Router from 'vue-router';
import mainContent from '@/components/mainContent/mainContent';
import home from '@/components/HelloWorld';

Vue.use(Router);

export default new Router({
	routes: [
		{
			path: '/',
			name: 'mainContent',
			component: mainContent,
            redirect: '/admin',
			children: [
				{
					path: '/admin',
                    name: 'admin',
					component: () => import('@/views/admin/home/home')
				},
				{
					path: '/adminManage',
					name: 'adminManage',
					title: '管理员管理',
					component: () =>
						import('@/views/admin/adminManage/adminManage')
				},
				{
					path: '/memberManage',
					name: 'memberManage',
					title: '会员管理',
					component: () =>
						import('@/views/admin/memberManage/memberManage')
				},
				{
					path: '/columnManage',
					name: 'columnManage',
					title: '栏目管理',
					component: () =>
						import('@/views/admin/columnManage/columnManage')
				},
				{
					path: '/articleManage',
					name: 'articleManage',
					title: '文章管理',
					component: () =>
						import('@/views/admin/articleManage/articleManage')
				},
				{
					path: '/tabManage',
					name: 'tabManage',
					title: '标签管理',
					component: () => import('@/views/admin/tabManage/tabManage')
				},
                {
                    path: '/commentManage',
                    name: 'commentManage',
                    title: '评论管理',
                    component: () => import('@/views/admin/commentManage/commentManage')
                }
			]
		},
		{
			path: '/home',
            name: 'home',
			component: () => import('@/views/home/index')
		},
		{
			path: '/login',
			name: 'login',
			component: () => import('@/views/admin/login')
		}
	]
});
